Repository navigation
ChallengeScheme.valueOf: Bearer and MAC no longer resolve to HTTP_OAuth - #1621
Merged
Merged
Conversation
…th (#1618) The lookup table mapped the names of HTTP_OAUTH_BEARER (HTTP_Bearer) and HTTP_OAUTH_MAC (HTTP_MAC) to HTTP_OAUTH, a copy-paste slip. valueOf now returns the matching constants. Added tests checking the two schemes and that every constant is found again by its name (HTTP_AWS_IAM and HTTP_AWS_QUERY deliberately resolve to HTTP_AWS_S3). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



The aim
Fixes #1618.
ChallengeScheme.valueOf("HTTP_Bearer")andvalueOf("HTTP_MAC")returnedHTTP_OAUTHinstead ofHTTP_OAUTH_BEARERandHTTP_OAUTH_MAC: a copy-paste slip in the lookup table. SinceChallengeSchemeequality compares names, a scheme read back by name was not equal to the constant it came from.The solution
The two entries of the lookup table now map to their own constants.
HTTP_AWS_IAMandHTTP_AWS_QUERYstill resolve toHTTP_AWS_S3, which looks intentional, so they are left unchanged.The same two lines are fixed in 2.6, 2.7 and 3.0. Tests: Bearer, MAC and OAuth are looked up by name, and every
ChallengeSchemeconstant must be found again byvalueOf(name)(the two AWS aliases excepted), so a similar slip fails the build.Reproduction
ChallengeScheme.valueOf("HTTP_Bearer")returnsHTTP_OAuth(technical nameOAuth) before the fix; no code of the core callsvalueOfitself, so only applications and extensions that do are affected.Check-list
🤖 Generated with Claude Code